Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Deploy-UserCertificate Functions to generate certs on SHA match #612

Merged
merged 14 commits into from
Oct 22, 2024

Conversation

jworkmanjc
Copy link
Contributor

@jworkmanjc jworkmanjc commented Oct 11, 2024

Issues

  • CUT-4309 - Update Deploy-UserCertificate Functions to generate certs on SHA match

What does this solve?

This release aims to reduce the amount of time required to generate and deploy certificates for users. In previous iterations of this script, the tool would generate a new command each time the script was run for each user. This version changes the command "trigger" to the SHA1 hash of a user's certificate and compares that value when running Start-DeployUserCerts.

This release also introduces a multi-threaded operation when the tool generates commands for "new" or "all" users in the radiusMembers list.

Is there anything particularly tricky?

How should this be tested?

Functionality for the changes should be already covered in our Pester tests for this module. To validate the changes in this pull request. Pull the branch, open up the scripts/automation/Radius directory in a PowerShell session and run the pester tests on one of our Pester Tests orgs:

./tests/Invoke-Pester.ps1 -JumpCloudApiKey {YourPesterTestAPIKey}

Screenshot 2024-10-21 at 1 35 57 PM

In terms of updating from a previous version of the 2.0.0 development branch of radius certs:

  • simply running this new version will generate new cert commands for each user, these new commands will have a trigger containing the SHA1 value of the user's cert. Subsequent times the script is run, commands for those users will not explicitly be re-generated unless the $forceGenerateCommands parameter is specified.

Before:
Screenshot 2024-10-11 at 1 56 47 PM

After:
Screenshot 2024-10-11 at 1 57 00 PM

Screenshots

Preliminary testing indicates that this version of the script runs about 47% faster than the previous version.

Newest version (running threads in parallel to generate commands)
Screenshot 2024-10-21 at 1 16 11 PM
Previous version (running single threaded and in sequence to generate commands)
Screenshot 2024-10-21 at 1 34 49 PM

@jworkmanjc jworkmanjc marked this pull request as ready for review October 21, 2024 19:39
@jworkmanjc jworkmanjc requested a review from a team as a code owner October 21, 2024 19:39
Copy link
Contributor

@gweinjc gweinjc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything looks good to me. Was able to test successfully in my org and the updated sha triggers are working.

Nice job!

Copy link
Contributor

@kmaranionjc kmaranionjc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work here. Tests good with my org.

@jworkmanjc jworkmanjc merged commit a0d38bb into Radius_2.0.0 Oct 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants